<?php
$htmlOptions = array(
    'id'    => 'search-box',
    'class' => 'content-box',
    'style' => '',
);

if (SpsState::hasState('search'))
    $htmlOptions['style'] = 'background:#e5ecf9 none;border:1px solid #aac6e8;';
else
    $htmlOptions['style'] = 'background:#e5ecf9 none;border:1px solid #aac6e8;display:none;';

echo CHtml::openTag('div', $htmlOptions);
?>
<?php
$form = $this->beginWidget('CActiveForm', array(
    'action'      => Yii::app()->createUrl($this->route),
    'method'      => 'get',
    'id'          => 'search-form',
    'htmlOptions' => array('class' => 'form'),
        ));
?>
<ul>
    <li>
        <?php echo $form->label($model, 'title', array('class' => 'search-label')); ?>
        <?php echo $form->textField($model, 'title', array('class' => 'text medium')); ?>
        <?php
        $data = DNewsletterType::model()->getMenu();

        $this->widget('ArrayToDropDownList', array(
            'model'         => $model,
            'attribute'     => 'type_id',
            'data'          => $data,
            'disableParent' => true,
            'emptyOption'   => strtolower(Yii::t('DadminModule.app', 'category')),
            'selected'      => $model->getAttribute('type_id'),
            'htmlOptions'   => array(
                'class' => 'select',
                'style' => 'width:150px;',
            )
        ));
        ?>
        <?php
        $data = Yii::t('DadminModule.app', 'select_activated_flag');
        echo $form->dropDownList($model, 'activated_flag', $data, array(
            'empty' => Yii::t('DadminModule.app', 'select_activated_flag_title'),
            'class' => 'select',
            'style' => 'width:85px',
        ));
        ?>
    </li>

    <li>
        <div style="margin:auto; width:120px;">
            <?php
            $label = Yii::t('DadminModule.app', 'submit_u');
            echo CHtml::link(
                '<span class="ui-icon ui-icon-arrowreturn-1-e"></span>' . $label, 'javascript:void(0)', array(
                'id'    => 'btn-submit',
                'class' => 'btn ui-state-default ui-corner-all',
            ));
            ?>
        </div>
    </li>
</ul>
<?php $this->endWidget(); ?>
<?php echo CHtml::closeTag('div'); ?>